<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="cdnload" content="vue" />
    <meta name="author" content="lijinbo" />
    <title>204-table样式美化</title>
    <link rel="stylesheet" href="./204-style.css" />
  </head>

  <body>
    <div id="app">
      <div v-for="(item, index) in list" :key="index">
        <p>{{ index + 1 }} - {{ item }}</p>
        <table :class="`table_${index + 1}`" cellspacing="0" cellpadding="0" border="0">
          <colgroup>
            <col width="150" />
            <col width="300" />
            <col width="150" />
          </colgroup>
          <thead>
            <tr>
              <th>姓名</th>
              <th>城市</th>
              <th>年龄</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td>张三</td>
              <td>北京</td>
              <td>15</td>
            </tr>
            <tr>
              <td>李四</td>
              <td>上海</td>
              <td>22</td>
            </tr>
            <tr>
              <td>tom</td>
              <td>洛杉矶</td>
              <td>25</td>
            </tr>
          </tbody>
        </table>
      </div>
    </div>
    <script>
      new Vue({
        el: '#app',
        data() {
          return {
            list: ['单像素边框CSS表格', '带背景图的CSS样式表格']
          }
        }
      })
    </script>
  </body>
</html>
